<template>
	<view class="" v-if="data">
		<view class="bgf t-flex colum content">
			<uv-image :src="$str.img(data.orderInfo.good_image)" mode="aspectFill"
			width="200rpx"
			height="160rpx"
			radius="20rpx"
			></uv-image>
			
			<view class="name f30 c3 bold">{{data.orderInfo.good_name}}</view>
			
			<view class="stars t-flex between">
				<view class="item" v-for="item in 5" :key="item" @click="value = item">
					<image :src="value>=item?'/static/icons/17.png':'/static/icons/18.png'" mode="aspectFit" class="icon"></image>
					<view class="f24 c3 mt20">{{label[item]}}</view>
				</view>
				
				
			</view>
			
		</view>
		<view class="Allbottom t-flex center safeArea" >
			<view class="btn t-flex center cf f30" @click="submit">发布</view>
		</view>
	</view>

	<loading v-else></loading>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import { onLoad } from "@dcloudio/uni-app"
import { orderDetail, orderMark } from '../../api';
import { routeFn } from '../../lib/ts/util';
	
	onLoad(options=>{
		getdata(options.id)
	})
	
	let data = ref('')
	const getdata = async (id:number)=>{
		data.value = await orderDetail(id)
	}
	
	
	let value = ref(4)
	let label = [,'极差','较差','一般','不错','很棒']
	

	const submit = async ()=>{
		let res = await orderMark({
			order_id:data.value.orderInfo.id,
			pf:value.value
		})
		uni.$emit('updateOrderList')
		routeFn.back(res.msg)
	}

</script>

<style scoped lang="scss">
	.content{
		padding: 40rpx 0;
	}
	.name{
		margin: 40rpx 0;
	}
	.stars{
		.icon{
			width: 40rpx;
			height: 40rpx;
		}
		.item{
			margin: 0 33rpx;
		}
	}
	
	
	
	
	
</style>
